<?php
include_once( PARAM_CLASS.'class.mysql.php' );
$mysql = new Tmysql();

$GLOBALS['tpl']->define( array(	'article' => 'articles/article.html',
                                'article_body' => 'articles/article_body.html'));

$mysql->sql_exe('   SELECT `tbl_articles`.`name` as `name`,
                           `tbl_articles`.`date` as `date`,
                           `tbl_articles`.`text` as `text`,
                           `tbl_user`.`name`     as `user`
                    FROM   `tbl_articles`, `tbl_user`
                    WHERE  `tbl_articles`.`hidden`=0
                    AND    (`tbl_articles`.`user`=`tbl_user`.`id`)
                    ORDER BY `tbl_articles`.`date`');
while($row=$mysql->fetch())
{
    $GLOBALS['tpl']->assign( array(	'TITLE' => $row['name'],
                                        'DATE'  => $row['date'],
                                        'USER'  => $row['user'] ,
                                        'TEXT'  => $row['text']));
}

$GLOBALS['tpl']->parse('ARTICLES', '.article');

$GLOBALS['tpl']->parse('CONTENT', 'article_body');

?>
